<template>
  <div class="home-page">
    <!-- 导航栏 -->
    <nav class="navbar">
      <router-link to="/home" class="nav-link">首页</router-link>
      <router-link to="/detail" class="nav-link">详情</router-link>
      <a href="https://gitee.com/houer-er/vue-hou.git" target="_blank" class="gitee-link">
        <img src="https://gitee.com/favicon.ico" alt="Gitee" class="gitee-icon">
      </a>
    </nav>
    <!-- 首页内容 -->
    <div class="home-content">
      <div class="content-wrapper">
        <h2>欢迎来到houer的电子商务网站</h2>
        <p>这里是首页的精彩内容展示区域。</p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
// 可添加首页相关逻辑
</script>

<style scoped>
/* 引入全局样式变量 */
@import '../assets/style.css';

/* 整体页面样式 */
.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--background-color);
  position: relative;
  overflow: hidden;
}

/* 导航栏样式 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 1rem 2rem;
  box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-size: 1.125rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.nav-link::after {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  transform: rotate(30deg);
  transition: all 0.7s ease;
}

.nav-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(138, 43, 226, 0.4), 0 5px 10px rgba(0, 0, 0, 0.1);
}

.nav-link:hover::after {
  left: 100%;
}

.gitee-link {
  display: flex;
  align-items: center;
}

.gitee-icon {
  width: 24px;
  height: 24px;
  transition: all var(--transition-speed) ease;
}

.gitee-icon:hover {
  transform: scale(1.2);
}

/* 首页内容样式 */
.home-content {
  flex: 1;
  display: flex;
  width: 100%;
  background-color: white;
  padding-top: 4rem; 
}

.content-wrapper {
  margin: auto; /* 使内容在父容器中居中 */
  text-align: center;
  padding: 20rem;
}

.content-wrapper h2 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 8px rgba(138, 43, 226, 0.2);
  margin-bottom: 1rem;
}

.content-wrapper p {
  font-size: 1.25rem;
  color: var(--text-color);
  max-width: 600px;
  margin: 0 auto; /* 水平居中 */
}
</style>